﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _81Action练习
{
    class Program
    {
        static void Main(string[] args)
        {
            //People p = new People();
            //p.Name = "雷潮";
            //Action a = p.Eat;
            //Run(a);

            People p = new People();
            p.Name = "李四";
            Action<string> a1 = Run;
            p.Look(a1);


             
            Console.ReadKey();
        }
        public static void Run(string name)
        {
            Console.WriteLine(name + "在跑步");
        }

            public static void Run(Action a)
        {


            //People p = new People();
            //p.Name = "雷潮";
            //p.Eat();

            a();
        }


    }

    class People
    {
        public string Name { set; get; }
        public void Eat()
        {
            Console.WriteLine(Name+"在吃东西");
        }
        public void Look(Action<string> a)
        {
            a(Name);
            Console.WriteLine(Name+ "在看电视");
        }
    }
}
